/*
 * *
 * author:xujinghai
 * date:18-5-28 下午3:37
 * /
 */

package com.kaili.common.exports;

import cn.afterturn.easypoi.entity.vo.NormalExcelConstants;
import com.kaili.common.exports.base.BaseExport;
import com.kaili.common.exports.base.ExportNotice;
import com.kaili.common.util.LoginDetailUtils;
import com.kaili.db.service.IHsOptEwbService;
import com.kaili.pojo.vo.EwbQueryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * package name:com.kaili.common.exports
 * author:hasee
 * date :2018/5/18
 * project:micro-service
 */
@Component
@ExportNotice(name = "托运开单查询导出")
public class ExportEwbQueryList extends BaseExport {
    @Autowired
    IHsOptEwbService ewbService;

    /**
     * 托运开单查询导出
     *
     * @param parm
     * @return
     */
    @Override
    public HashMap doExport(Map parm) {
        HashMap ret = new HashMap();
        Integer siteId = LoginDetailUtils.getSiteId();
        if (siteId != null && siteId != 1) {
            parm.put("siteId", siteId);
        }
        ret.put(NormalExcelConstants.CLASS, EwbQueryVO.class);
        List<EwbQueryVO> list = ewbService.queryEwbList(parm);
        ret.put(NormalExcelConstants.DATA_LIST, list);
        return ret;
    }
}
